package com.Al.pattern.singleton;

/**
 * @Author lizhigang Date: 2019/4/17 22:11
 * @description: 饿汉式单例，在加载的时候就已经创建了
 *   优点：绝对线程安全、没加任何锁，执行效率比较高
 *   缺点：容易浪费资源,类加载的时候就初始化,不管你用不用一直站着空间
 */

public class HungrySingleton {
	private static final HungrySingleton HUNGRY_SINGLETON = new HungrySingleton();

	private HungrySingleton(){};

	public static HungrySingleton newInstence(){
		return HUNGRY_SINGLETON;
	}
}
